A cache is a collection of data that is a duplication of original values stored elsewhere or computed earlier when the original data is expensive to fetch or to compute relative to retrieval from the cache. Upon receipt of a data access request, the data may optionally be looked up in the cache as opposed to performing the fetch against the underlying storage, and the look up will result in either a cache hit (i.e. found in the cache) or a cache miss (i.e. not found in the cache). File, operating, and database management systems may use a cache to store frequently accessed data in order to avoid issuing Input/Output (I/O) requests to read and write the data from the underlying storage.
In particular, database management systems may employ the use of a database buffer cache in addition to the cache available from an operating system. The database buffer cache stores the data from the database, a collection of data stored on one or more disks, in order to service database requests without the I/O read and write costs. The underlying storage used by a file system or a database system may take on many forms including but not limited to one or more disk drives on a network. Generally, accessing data through the cache requires less I/O requests to storage options (e.g. disk drives) thereby reducing the time for retrieval of the data.
In some cases, it may be beneficial to access the underlying data storage directly by issuing I/O requests against the storage instead of accessing the data through the cache. For example, accessing an infrequently referenced table of a database through the cache may not reduce the response time for data retrieval because the I/O request may not be avoided if the table is not in the cache. Moreover, the placement in the cache of an infrequently accessed large table may require removal of more frequently accessed data and result in overall poor response time for the database. Therefore, a choice must be made between accessing the data using the cache or accessing the I/O storage by issuing I/O requests against the storage.